Dynamic imports for Node packages in browser target#15
Conversation
|
this looks great - ive been sloppy at doing this (but then again not actively trying it all out in a browser env..) so appreciate this. Let me know when all good and ill check it all through (NB: I have a examples/vite demo called via https://github.com/willwade/AACProcessors-nodejs/blob/main/examples/browser-test-server.js - i dare some bad logic in that. but that was my quick test all was working.. |
|
Ps. If you have any good suggestions of supporting the SQLite engines I’m all ears.. |
|
The bundler now lets me import it and it works with the test file I have. 🎉 My instinct would be to use https://github.com/sqlite/sqlite-wasm for browser support of Sqlite formats. |
|
great. Ill merge this and work on a PR for the sqlite ones. Ill see how performant it is.. im nervous as it sounds messy..but lets see |
|
So published. @chrisbaume im working on this next part at #16 if you get a chance to fix in react let me know. Jszip is far slower than admzip so having to do some things to keep it all as performant in node. |
|
Thanks, I'll keep an eye on that. I've made a start over here: https://github.com/sonicbaume/FreeAAC - early days though. |
These changes remove any remaining node-related imports for the browser package:
getFsandgetPathin obfValidatorgetNodeRequireto importadm-zipgetXml2jsfunction (based ongetAdmZip) in gridsetValidator